<?php
/**
 * com_easiv3_mi
 * 
 * @author Lukas Gruber
 * @copyright 2012, Lukas Gruber
 * @license GNU/GPLv3 - http://www.gnu.org/licenses/gpl-3.0.html
 * @contact lukasgruber@gmx.net
 * @website http://www.lukasg255.bplaced.net
 */

class XmlParser {

	function getNode($xmlFile, $requestedNode)
	{
		if(file_exists($xmlFile))
		{
			$xml = @simplexml_load_file($xmlFile);
			
			if(!$res = $xml->xpath($requestedNode))
			{
				return "noNode";
			}
			else
			{
				return $res[0];
			}
			
		}
		else
		{
			return "noFile";
		}
	}
	
	function getExtensionType($xmlFile)
	{
		if(file_exists($xmlFile))
		{
			$xml = @simplexml_load_file($xmlFile);
			
			return $xml['type'];			
		}
		else
		{
			return "noFile";
		}
	}
}
?>